<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>订单详情</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/jquery.cookie.js"></script>
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css"/>
    <link rel="stylesheet" type="text/css" href="css/orderdetails.css"/>
</head>
<body>
    <div class="container" id="returnindex">
        <div class="row">
            <div class="col-xs-9 col-sm-9 col-md-9 col-lg-9"></div>
            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1" id="returnshop"></div>
            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1" id="ordermanage"></div>
            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"><a href="index.html">返回首页</a></div>
        </div>
    </div>
    <div class="container" id="pagetitle">
        <div class="row">
            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
            <div class="col-xs-3 col-sm-3 col-md-3 col-lg-3"><p id="titlep"><span>乐享生活</span>&nbsp;订单详情</p></div>
            <div class="col-xs-5 col-sm-5 col-md-5 col-lg-5"></div>
            <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2"></div>
            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
        </div>
    </div>
    <div class="container" id="detailsbody">
        <div class="row a">
            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1" id="detailstop">订单信息</div>
            <div class="col-xs-11 col-sm-11 col-md-1 col-lg-11" id="bottom"><p id="consumer">消费者热线：0571-88158198</p></div>
        </div>
        <div class="row" id="orderinfo">
            <div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
            <div class="col-xs-10 col-sm-10 col-md-10 col-lg-10" id="info">

            </div>
        </div>
    </div>

    <script type="text/javascript">

        var id = location.search.split("=")[1];

        $.post("order/findById",{id:id},function (data) {
            data = JSON.parse(data);

            var start = '';
            var end = '';

            for (var i = 0; i < 3; i++) {
                start += data.user.telephone[i];
            }

            for (var i = 7; i < data.user.telephone.length; i++) {
                end += data.user.telephone[i];
            }

            var expressname,expressnumber,sendtime;

            if (data.state == 1){
                expressname = '尚未发货';
                expressnumber = '尚未发货';
                sendtime = '尚未发货';
            } else {
                expressname = data.expressName;
                expressnumber = data.expressNumber;
                sendtime = data.sendTime;
            }


            var ht = '<div class="row">\n' +
                '          <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 infos">\n' +
                '                <h1>商家信息</h1><P>昵称：'+ data.user.username +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;真实姓名：'+ data.user.name[0] +'xx&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;电话：'+ start +'xxxx'+ end +'</P>\n' +
                '          </div>\n' +
                '     </div>\n' +
                '     <div class="row">\n' +
                '          <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 infos">\n' +
                '               <h1>收货地址</h1><P>'+ data.address.province +'&nbsp;&nbsp;'+ data.address.city +'&nbsp;&nbsp;'+ data.address.details +'</P>\n' +
                '          </div>\n' +
                '     </div>\n' +
                '     <div class="row">\n' +
                '          <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 infos">\n' +
                '               <h1>快递信息</h1><P>快递名称：'+ expressname +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;运单编号：'+ expressnumber +'</P>\n' +
                '          </div>\n' +
                '     </div>\n' +
                '     <div class="row">\n' +
                '          <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 infoslast">\n' +
                '               <h1>订单信息</h1><P>订单编号：'+ data.orderNumber +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;创建时间：'+ data.createTime +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;支付时间：'+ data.payTime +'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;发货时间：'+ sendtime +'</P>\n' +
                '               <div class="row">\n' +
                '                    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 goodstitle">商品</div>\n' +
                '                    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 goodstitle">商品类型 </div>\n' +
                '                    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 goodstitle">单价</div>\n' +
                '                    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 goodstitle">数量</div>\n' +
                '               </div>\n' +
                '               <div class="row">\n' +
                '                    <div class="col-xs-6 col-sm-6 col-md-6 col-lg-6 goodsimg"><img src="/FVOnline/goods/getImg?goodsId=' + data.goodsId +'">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+ data.goods.goodsname +'&nbsp;&nbsp;&nbsp;&nbsp;'+ data.goods.details +'</div>\n' +
                '                    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 goods">'+ data.goods.type +'</div>\n' +
                '                    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 goods">￥'+ data.goods.price +'</div>\n' +
                '                    <div class="col-xs-2 col-sm-2 col-md-2 col-lg-2 goods">'+ data.tradeNum +'</div>\n' +
                '               </div>\n' +
                '               <div class="row">\n' +
                '                    <div class="col-xs-12 col-sm-12 col-md-12 col-lg-12 lastpay">\n' +
                '                         <P>商品总价：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;￥'+ data.tradePrice +'</P>\n' +
                '                         <P>运&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;费：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;￥0.00</P>\n' +
                '                         <P>实&nbsp;&nbsp;付&nbsp;&nbsp;款：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;￥'+ data.tradePrice +'</P>\n' +
                '                    </div>\n' +
                '               </div>\n' +
                '          </div>\n' +
                '     </div>';
            $("#info").html(ht);
        });

    </script>
</body>
</html>